<template>
    <div class="gonggao-detail" v-loading="loading">
        <div>
            <e-container>
                <div class="title-modelbox-widget1">
                    <h3 class="section-title">公告详情</h3>
                    <div class="sidebar-widget-body">
                        <div>
                            <div class="common-title" style="margin-top: 4em">
                                <p>
                                    <i></i>
                                    <i></i>
                                </p>
                            </div>
                            <div class="news_show">
                                <div style="float: right"></div>
                                <span class="show_t" v-html="map.gonggaobiaoti"> </span>
                                <span class="fa_time"> 公告编号:{{ map.gonggaobianhao }} &nbsp;&nbsp; 发布人:{{ map.faburen }} &nbsp;&nbsp; </span>

                                <div v-html="map.gonggaoneirong"></div>

                            </div>
                        </div>
                    </div>
                    <!-- /.sidebar-widget-body -->
                </div>
            </e-container>
        </div>
    </div>
</template>
<style type="text/scss" scoped lang="scss"></style>
<script>
    import api from "@/api";
    import { extend } from "@/utils/extend";
    import jdk from "@/utils/extend";
    export default {
        data() {
            return {
                loading: false, // 加载

                map: {
                    gonggaobianhao: "",
                    gonggaobiaoti: "",
                    gonggaotupian: "",
                    gonggaoneirong: "",
                    faburen: "",
                    addtime: "",
                },
                prev: {},
                next: {},
            };
        },
        props: {
            id: {
                type: [String, Number],
                required: true,
            },
        },
        watch: {
            id: {
                handler() {
                    this.loadDetail();
                },
                immediate: true,
            },
        },
        computed: {},
        methods: {
            loadDetail() {
                if (this.loading) return;
                this.loading = true;
                this.$get(api.gonggao.webdetail, {
                    id: this.id,
                })
                    .then((res) => {
                        this.loading = false;
                        if (res.code == api.code.OK) {
                            extend(this, res.data);
                        } else {
                            this.$message.error(res.msg);
                        }
                    })
                    .catch((err) => {
                        this.loading = false;
                        this.$message.error(err.message);
                    });
            },
        },
        created() {},
        mounted() {},
        destroyed() {},
    };
</script>
